// pages/event/event.js
import {post} from '../../service/network.js'
let appObj = getApp()
appObj.globalData.code
Page({
  /**
   * 页面的初始数据
   */
  data: {
    counter: 0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options)
    post({
      url:'http://192.168.6.5:8881/basicplate-new-service/plate/menu/subsystemList'
    }).then((res) => {
      console.log(res)
    })
//     wx.request({
//       url: 'http://192.168.6.5:8881/basicplate-new-service/plate/menu/subsystemList',
//       method: 'post',
//       // url:'http://123.207.32.32:8000/recommend',
//       header:{
// 'Authorization':`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcmVhQ29kZSI6IjUxMDAwMCIsInVzZXJfbmFtZSI6Imd1b3lhbmNodW4iLCJzY29wZSI6WyJ3ZWJjbGllbnQiXSwibG9naW5OYW1lIjoiZ3VveWFuY2h1biIsImV4cCI6MTU3MTczNTY4NCwidXNlck5hbWUiOiLpg63oibPmmKUiLCJ1c2VySWQiOjE0OCwiYXV0aG9yaXRpZXMiOlsiVVNFUiJdLCJqdGkiOiJjODdmM2Y0Ny1mZTk2LTQ3ZDktYjVhYy00MTE0ZDcwNjcyMWYiLCJvcmdJZCI6MywiY2xpZW50X2lkIjoic3VwZXJub3ZhX3dlYl9jbGllbnQifQ.2KRhlc_BgaOWgHsmMWR60i88JAz5GctJzNk4OarvIW4`
//       },
//       success: function (res) {
//         console.log(res)
//       }
//     })
    // wx.request({
    //   url: 'http://httpbin.org/post',
    //   method:'post',
    //   data:{
    //     name:'coderwhy',
    //     age:18
    //   },
    //   success: function (res) {
    //     console.log(res)
    //   }
    // })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  handCaptureView1 () {
    console.log('handCaptureView1')
  },
  handBindView1 () {
    console.log('handBindView1')
  },
  handCaptureView2() {
    console.log('handCaptureView2')
  },
  handBindView2() {
    console.log('handBindView2')
  },
  handCaptureView3() {
    console.log('handCaptureView3')
  },
  handBindView3() {
    console.log('handBindView3')
  },
  handIncrement () {
    console.log(111)
    this.setData({
      counter:this.data.counter + 1
    })
  },
  //直接修改方式不合理
  upadteCompontsData () {
    let selectComponent = this.selectComponent('.select')
    selectComponent.setData({
      conster: selectComponent.data.conster + 1
    })
    console.log(selectComponent)
  }
})